import 'package:flutter/material.dart';

// 加载图片，根据图片路径
Widget loadImageByUrl(String? imagePath, double width, double height) {
  if (imagePath == null) {
    return Container();
  }
  if (imagePath.startsWith('http')) {
    return Image.network(
      imagePath,
      width: width,
      height: height,
      fit: BoxFit.cover,
    );
  } else {
    return Image.asset(
      imagePath,
      width: width,
      height: height,
      fit: BoxFit.cover,
    );
  }
}

// 示例图片
String exampleImagePath = 'assets/images/lufei.png';